package com.atguigu.yygh.common.exption;


import com.atguigu.yygh.common.result.Result;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Author liking
 * @Description 全局异常处理类
 * @Date 2025/4/28
 * @Version 1.0
 */

@ControllerAdvice
public class MyGlobelExption {

    @ExceptionHandler(Exception.class)
    @ResponseBody
    public Result doException(Exception e){
        e.printStackTrace();
        return Result.fail();
    }

}
